<?php

namespace app\index\controller;
use app\FrontController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\Validate;
use support\Request;
class ArticalController extends FrontController{

    private $domain = '';
    
    public function __construct()
    {
        parent::__construct();
    }
    
    public function getartical($name,$id)
    {
        
        $get = ['name'=>$name,'id'=>$id];
       
        $ret['code'] = 1;
        $ret['msg'] = '获取成功';
        $ret['catid'] = 0;
        $ret['top_tab'] = '5';
        $ret = array_merge($ret,$this->assign_arr);
         
        $ret['id'] = $get['id'];
        if($ret['id'] == '39'){
            $ret['top_tab'] = '5';
        }
        if($ret['id'] == '38'){
            $ret['top_tab'] = '6';
        }
        
     
        return view("artical/getartical",$ret);
    }
    public function articallist()
    {
        $get = $this->request->all();
        $tab = array();
        if(isset($get['catid'])){
            $tab = array(
                'catid'=>$get['catid'],
                "top_tab"=>'4'
            );
        } else {
            $tab = array(
                'catid'=>'',
                "top_tab"=>'4'
            );
        }
        $tab = array_merge($tab,$this->assign_arr);
        return view("artical/articallist",$tab);
    }
}